﻿<%@ Page Language="C#" MasterPageFile="~/SiteAdmin/MasterTheme/Auto.master" AutoEventWireup="true"
    CodeFile="UserMan.aspx.cs" Inherits="UserMan" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
        <asp:View ID="View1" runat="server">
            <asp:HyperLink ID="Button1" runat="server" Text="创建用户" NavigateUrl='<%# "UserMan.aspx?Rp="+Button2.ClientID+"&Uid=-1" %>'
                Target="_blank" CssClass="border_DDR" Width="68px" />
            <asp:Button Style="display: none;" ID="Button2" runat="server" OnClick="Button2_Click1"
                Text="Refresh" /><br />
            <asp:GridView ID="GridView1" DataKeyNames="ID" runat="server" AutoGenerateColumns="False"
                OnRowDeleting="GridView1_RowDeleting">
                <Columns>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "UserMan.aspx?Rp="+Button2.ClientID+"&Uid="+Eval("ID") %>'
                                Target="_blank" Text="查看"></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Name" ReadOnly="True" HeaderText="登录名" />
                    <asp:BoundField DataField="Title" HeaderText="显示名" />
                    <asp:BoundField DataField="Province" HeaderText="单位" />
                    <asp:BoundField DataField="email" HeaderText="邮箱" />
                    <asp:BoundField DataField="telephone" HeaderText="电话" />
                    <asp:BoundField DataField="cellphone" HeaderText="手机" />
                    <asp:BoundField DataField="isactive" HeaderText="激活" />
                    <asp:BoundField DataField="isregaudit" HeaderText="审核" />
                    <asp:BoundField DataField="RoleID" HeaderText="角色" />
                    <asp:TemplateField HeaderText="前后台">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# "2".Equals(Eval("GroupID"))?"2-后台":"1-前台" %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:ButtonField HeaderText="操作" CommandName="Delete" Text="删除" />
                </Columns>
                  <RowStyle BackColor="#EFF3FB" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" Height="25px"/>
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
        </asp:View>
        <asp:View ID="View2" runat="server">
            <asp:DetailsView ID="DetailsView1" DefaultMode="Edit" runat="server" Height="50px"
                Width="80%" OnItemUpdating="DetailsView1_ItemUpdating" DataKeyNames="ID" HorizontalAlign="Center"
                AutoGenerateRows="False" BorderWidth="1px" CellPadding="1" CellSpacing="1" CssClass="mytable2">
                <Fields>
                    <asp:BoundField DataField="Id" ReadOnly="True" Visible="False" HeaderText="ID" />
                    <asp:BoundField DataField="Name" ControlStyle-ForeColor="red" HeaderText="登录名*" />
                    <asp:BoundField DataField="Title" ControlStyle-ForeColor="red" HeaderText="显示名*" />
                    <asp:BoundField DataField="Pwd" ControlStyle-ForeColor="red" HeaderText="密码*" />
                    <asp:BoundField DataField="Province" HeaderText="单位" />
                    <asp:BoundField DataField="addr" HeaderText="地址" />
                    <asp:BoundField DataField="email" HeaderText="邮箱" />
                    <asp:BoundField DataField="telephone" HeaderText="固定电话" />
                    <asp:BoundField DataField="cellphone" HeaderText="移动电话" />
                    <asp:CheckBoxField DataField="isactive" HeaderText="是否激活" />
                    <asp:BoundField DataField="descript" HeaderText="描述" />
                    <asp:CheckBoxField DataField="isregaudit" ReadOnly="True" HeaderText="是否审核" />
                    <asp:BoundField DataField="regreqtime" ReadOnly="True" HeaderText="注册时间" />
                    <asp:BoundField DataField="regaudtime" ReadOnly="True" HeaderText="创建时间" />
                    <asp:TemplateField HeaderText="用户角色">
                        <EditItemTemplate><asp:DropDownList ID="DropDownList1" runat="server" Text='<%# Bind("RoleID") %>'>
                                <asp:ListItem>Admin</asp:ListItem>
                                <asp:ListItem>Manager</asp:ListItem>
                                <asp:ListItem>Editor</asp:ListItem>
                                <asp:ListItem Selected="true">Member</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="前台/后台">
                        <EditItemTemplate><asp:DropDownList ID="DropDownList2" runat="server" Text='<%# Bind("GroupID") %>'>
                                <asp:ListItem Text="2-后台" Value="2"></asp:ListItem>
                                <asp:ListItem Text="1-前台" Value="1" Selected="true"></asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <EditItemTemplate>
                            <div style="text-align: center; vertical-align: middle">
                                <asp:Button ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                    Text="保存"></asp:Button>
<%--                                <asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="javascript:{window.close();return false;}">关闭窗口</asp:LinkButton>--%>                            </div>
                        </EditItemTemplate>
                    </asp:TemplateField>
                </Fields>
            </asp:DetailsView>
            <div align="center">
            </div>
        </asp:View>
    </asp:MultiView>
</asp:Content>
